package com.farm.farming.exception;

import com.farm.entity.Result;
import com.farm.entity.StatusCode;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class Myexception {

    @ExceptionHandler(Exception.class)
    public Result error(Exception e){

        e.printStackTrace();
        return new Result(false, StatusCode.ERROR,e.getMessage());
    }
}
